<%@page contentType='text/html; charset=UTF-8' %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html>

	<head>
		<meta charset='utf-8'>
		<title>部门列表页面</title>
<%--		base标签只对没有/开头的起作用         --%>
<%--		在JS代码中的路径最好不要使用base标签       --%>
		<base href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/"/>
		<style type='text/css'>
			table{
				height:200px;
				width:350px;
				border:2px solid pink;
				border-collapse:collapse;
			}
			a{
				color:black;
				text-decoration:none;
			}
			a:hover{
				color:pink;
				text-decoration:underline;
				cursor:pointer;
			}
		</style>
		
	</head>

	<body>

	<h1>欢迎${username}</h1>
	<a href='user/exit'>安全退出系统</a>


		<h1 align='center'>部门列表</h1>
		<hr color='green'/>
			<table border='1px' align = 'center'>
				<tr>
					<th>序号</th>
					<th>部门编号</th>
					<th>部门名称</th>
					<th colspan='3'>操作</th>
				</tr>
				<c:forEach items="${dept}" var="dept" varStatus="deptStatus" >
				<tr>
					<td align='center'>${deptStatus.count}</td>
					<td align='center'>${dept.deptno}</td>
					<td align='center'>${dept.dname}</td>
					<td align="center"><a href="dept/delete?deptno=${dept.deptno}">删除</a></td>
					<td align='center'><a href='dept/detail?flag=t&deptno=${dept.deptno}'>修改</a></td>
					<td align='center'><a href='dept/detail?flag=f&deptno=${dept.deptno}'>详情</a></td>
				</tr>
				</c:forEach>
			</table>
			<hr color='pink'/>
			<a href='add.jsp'>新增部门</a>
		
	</body>

</html>